package pt.compflow.storage;

import pt.compflow.flowontology.model.FlowOntologyModel;

import com.hp.hpl.jena.graph.Graph;
import com.hp.hpl.jena.ontology.OntModel;

/**
 * Interface for CompFlow TripleStore storage mechanisms
 * Regardless of the persistence mechanism, they must use Jena Graph and Model APIs
 * A TripleStore handles a single connection to a TripleStore
 * 
 */
public interface TripleStoreConnection {
	
	/**
	 * Opens a connection to the TripleStore with the default config file/params
	 */
	public void openStore();
		
	/**
	 * Close the connection to the TripleStore
	 */
	public void closeStore();
		
	/**
	 * Connect to a global or named graph in the TripleStore
	 * The ontology is not included in these models
	 * @return the FlowOntologyModel wrapping the TripleStore graph
	 */
	public FlowOntologyModel connectModel();
	public FlowOntologyModel connectNamedModel(String iri);
	
	public OntModel connectNamedOntModel(String iri);
				
	/**
	 * Connect to a global or named graph in the TripleStore
	 * @return the Jena Graph structure 
	 */
	public Graph connectGraph();
	public Graph connectNamedGraph(String iri);
	
}
